#include <tsin/library/BulletLineDirector.hpp>

#include <tsin/runtime/BulletRuntime.hpp>
#include <tsin/util/Logger.hpp>

#include <cstring>
#define _USE_MATH_DEFINES
#include <cmath>

#include <tsin/util/MemCheck.hpp>
using namespace tsin;

void BulletLineDirector::init(float angle)
{
        this->angle = angle;
}

void BulletLineDirector::reinit()
{
        float arg1 = arguments[0]->getFloatInRad();

        switch(nrArguments) {
        case 1:
                if (strcmp(desp, "N") == 0)
                        init(arg1);
                break;
        }
}

void BulletLineDirector::reset()
{
}

void BulletLineDirector::direct(BulletRuntime *bullet, void *)
{
        bullet->direction = angle;
}

DynamicObject *bindLineDirector()
{
        return new BulletLineDirector;
}
